# Maintainer: Jürgen Pfeifer <juergen@familiepfeifer.de>
# Contributor: Tim S <stahta01@gmail.com>

_realname=gprbuild-gpl
pkgbase=mingw-w64-${_realname}
pkgname=${MINGW_PACKAGE_PREFIX}-${_realname}
pkgver=2020.0.43e55df
pkgrel=1
pkgdesc="Software tool designed to help automate the construction of multi-language systems (mingw-w64)"
arch=('any')
provides=("${MINGW_PACKAGE_PREFIX}-${_realname%-*}")
license=('GPL3')
url="https://www.adacore.com/gnatpro/toolsuite/gprbuild/"
makedepends=("${MINGW_PACKAGE_PREFIX}-gcc-ada"
             "${MINGW_PACKAGE_PREFIX}-xmlada"
             "${MINGW_PACKAGE_PREFIX}-gprbuild-bootstrap-git")
depends=("${MINGW_PACKAGE_PREFIX}-gcc-ada"
         "${MINGW_PACKAGE_PREFIX}-xmlada")
conflicts=("${MINGW_PACKAGE_PREFIX}-gprbuild-bootstrap")
source=("${_realname}"::"git+https://github.com/AdaCore/gprbuild.git#commit=43e55df6c26e2bd48ab6c2f4214f497c4ddbc943")
sha256sums=('SKIP')

prepare() {
  cd ${srcdir}/gprbuild-gpl

  #./bootstrap.sh
}

build() {
  cd ${srcdir}/gprbuild-gpl

  make SOURCE_DIR="$PWD" prefix=${MINGW_PREFIX} setup

    make
}

package() {
  cd ${srcdir}/gprbuild-gpl
  make prefix="${pkgdir}${MINGW_PREFIX}" INSTALL=cp install

  # Copy License Files
  mkdir -p ${pkgdir}${MINGW_PREFIX}/share/licenses/${_realname}
  cp -pf COPYING* ${pkgdir}${MINGW_PREFIX}/share/licenses/${_realname}/
}
